package com.bw.zg3park2212.fg

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.bw.base.mvvm.BaseFram
import com.bw.zg3park2212.R
import com.bw.zg3park2212.adpter.MsgAdpter
import com.bw.zg3park2212.databinding.FragmentBlank3Binding
import com.bw.zg3park2212.viewmodel.MsgViewMode
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class BlankFragment3 : BaseFram<FragmentBlank3Binding,MsgViewMode>() {
    lateinit var msgAdpter: MsgAdpter
    override fun intitView() {
        msgAdpter= MsgAdpter()
        binding.rv.adapter=msgAdpter
        binding.rv.layoutManager=LinearLayoutManager(context)
        viewmodel.getMsg("0a47f73f35dd4cf291d9b9c9e16942bd",1)
    }

    override fun intitData() {
        viewmodel.msgSuccse.observe(this){
            msgAdpter.data.clear()
            msgAdpter.addData(it)
            msgAdpter.notifyDataSetChanged()
        }
    }

}